{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 集成速度陀螺仪数据\n",
    "汽车的**横摆角速度**可以通过**速率陀螺仪**来测量。\n",
    "\n",
    "横摆角速度指的是汽车以每秒弧度的方向的变化率，并且由于汽车的前进方向通常由希腊字母 $\\theta$（theta）表示，所以横摆**角速度**由$\\dot{\\theta}$（theta dot）表示。\n",
    "\n",
    "对横摆角速度进行集成可以改变汽车整体的行驶方向。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from helpers import process_data, get_derivative_from_data\n",
    "from matplotlib import pyplot as plt\n",
    "\n",
    "PARALLEL_PARK_DATA = process_data(\"parallel_park.pickle\")\n",
    "\n",
    "TIMESTAMPS    = [row[0] for row in PARALLEL_PARK_DATA]\n",
    "DISPLACEMENTS = [row[1] for row in PARALLEL_PARK_DATA]\n",
    "YAW_RATES     = [row[2] for row in PARALLEL_PARK_DATA]\n",
    "ACCELERATIONS = [row[3] for row in PARALLEL_PARK_DATA]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEWCAYAAACaBstRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XmcXGWd7/HPt6pDwr4lYCSEoKDIqCy2cBVlUWBgRAGvC7jhqK+Md8BRQYQ7jqhcF9yXEeeaiwgqiIALEVmNEkRFCPsEZDEiREIIOwG66ar+3T/OqaRoOt2nl1PL09/369Wv1Dl1us6vksp56vf8nvM8igjMzMyKqLQ7ADMz6x5uNMzMrDA3GmZmVpgbDTMzK8yNhpmZFeZGw8zMCnOjYTaFSLpM0jvbHYd1Lzca1p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6s62u04bE/B15H1rV2B7A4378xcIGkGWRZyUebfmcv4DOYFeRZbs0miaSPAk9ERMfcqzESSbsBx0bEu9sdi3UPd0+ZTZ7/4tm1hk43E/hku4Ow7uJMw8zMCnOmYWZmhbnRMDOzwtxomJlZYW40zMysMDcaZmZW2P8HmTHwnOdHEWYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.title(\"Yaw Rate vs Time\")\n",
    "plt.xlabel(\"Time (seconds)\")\n",
    "plt.ylabel(\"Yaw Rate (radians / second)\")\n",
    "plt.plot(TIMESTAMPS, YAW_RATES)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "下面是我对这些数据的看法\n",
    "\n",
    "**从 t=0 到 t=1**: 横摆角速度为零，因此车轮是直的（或者车辆没有移动）。这表示汽车正在直线后退。\n",
    "\n",
    "**从 t=1 到 t=2**: 这表示司机正在将方向盘严格切到右侧并保持后退。由于横摆角速度不为零，这意味着车辆正在转弯。\n",
    "\n",
    "**从 t=2 到 t=3**: 这表示司机将车轮切回左侧进行矫直。\n",
    "\n",
    "**t=3 之后**: 车辆没有转弯，所以它可能只是通过缓慢前进和/或后退来调整其位置。\n",
    "\n",
    "### 你的工作\n",
    "在该 notebook 中，你需要自己编写`get_integral_from_data`函数，然后使用该函数在汽车行驶时跟踪它的行驶方向。\n",
    "\n",
    "首先，看一看当你的函数正常运行时，综合速度陀螺仪数据应该是什么样子的。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8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n680XGTOr2TZB3wv4BbgFngEHBnVT0/0sJWKclNwHeBf1NVf2HU9QxCkvcA76mqryX5M8Bh4I5J/lolCfD2qvpuksuB3wN+vqqeHnFpA5HkHmAK+MGq+ulR17NaSb4JTFVVa+7RT/JZ4L9W1WeSXAH8QFW9stRxk/xKfydwrKqOV9XrwAHg9hHXtGpV9V+A06OuY5Cq6o+q6mu9j/8v8AKwabRVrU7N+W5v8/Len8l8BTVPks3ATwGfGXUtWliSHwRuAh4GqKrXmzR8mOymvwk40bc9y4Q3ki5IshXYAXxltJWsXm8K5FngJeCJqpr4c+r558A/Ar436kIGqID/kORwkr2jLmYA3gecAn69Nw33mSRvb3LgJDf9LLCvFa+02irJO4AvAP+gqr4z6npWq6rerKrrgc3AziQTPx2X5KeBl6rq8KhrGbAbq+pHgQ8BH+9No06yy4AfBf5VVe0A/h/QaF1zkpv+LHBN3/Zm4OSIatESevPeXwB+o6q+OOp6Bqn33+ovA7tHXMog3Ajc1psDPwB8MMm/G21Jq1dVJ3t/vwR8ibnp4Uk2C8z2/e/y88z9I7CkSW76h4DtSbb1FjH2ANMjrkkL6C16Pgy8UFW/Nup6BiHJxiQbeh+vB24Gvj7aqlavqu6vqs1VtZW5n6knq+qjIy5rVZK8vXcDAb0pkFuBib47rqr+GDiR5Nrerp8EGt0YcdnQqhqyqjqb5G7gILAOeKSqjoy4rFVL8pvAXwWuSjILPFBVD4+2qlW7EfhbwHO9OXCAf1JVj4+wptV6D/DZ3l1kbwEerapW3N7YQn8W+NLcaw8uAz5XVb872pIG4u8Dv9F70Xsc+NtNDprYWzYlScs3ydM7kqRlsulLUofY9CWpQ2z6ktQhNn1J6hCbviR1iE1fkjrEpi9JHfL/Afv6VhDkKKIKAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from helpers import get_integral_from_data as solution_integral\n",
    "\n",
    "thetas = solution_integral(YAW_RATES, TIMESTAMPS)\n",
    "\n",
    "plt.scatter(TIMESTAMPS[1:], thetas)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "正如你所看到的，车辆的行驶方向最初是$\\theta = 0 \\text{ radians}$。从$t=1$到$t=2$，标题增加到最大约$0.28 \\text{ radians}$（大约16度）。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_integral_from_data(data, times):\n",
    "    # TODO - write integration code!\n",
    "    return"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "x and y must be the same size",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-5-62ff79f23616>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      4\u001b[0m \u001b[0mthetas\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_integral_from_data\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mYAW_RATES\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTIMESTAMPS\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 6\u001b[0;31m \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mscatter\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mTIMESTAMPS\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mthetas\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      7\u001b[0m \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshow\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m~/tools/conda3/lib/python3.6/site-packages/matplotlib/pyplot.py\u001b[0m in \u001b[0;36mscatter\u001b[0;34m(x, y, s, c, marker, cmap, norm, vmin, vmax, alpha, linewidths, verts, edgecolors, hold, data, **kwargs)\u001b[0m\n\u001b[1;32m   3468\u001b[0m                          \u001b[0mvmin\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mvmin\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvmax\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mvmax\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0malpha\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0malpha\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   3469\u001b[0m                          \u001b[0mlinewidths\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mlinewidths\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mverts\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mverts\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 3470\u001b[0;31m                          edgecolors=edgecolors, data=data, **kwargs)\n\u001b[0m\u001b[1;32m   3471\u001b[0m     \u001b[0;32mfinally\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   3472\u001b[0m         \u001b[0max\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_hold\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mwashold\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m~/tools/conda3/lib/python3.6/site-packages/matplotlib/__init__.py\u001b[0m in \u001b[0;36minner\u001b[0;34m(ax, *args, **kwargs)\u001b[0m\n\u001b[1;32m   1853\u001b[0m                         \u001b[0;34m\"the Matplotlib list!)\"\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mlabel_namer\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__name__\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1854\u001b[0m                         RuntimeWarning, stacklevel=2)\n\u001b[0;32m-> 1855\u001b[0;31m             \u001b[0;32mreturn\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0max\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   1856\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1857\u001b[0m         inner.__doc__ = _add_data_doc(inner.__doc__,\n",
      "\u001b[0;32m~/tools/conda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py\u001b[0m in \u001b[0;36mscatter\u001b[0;34m(self, x, y, s, c, marker, cmap, norm, vmin, vmax, alpha, linewidths, verts, edgecolors, **kwargs)\u001b[0m\n\u001b[1;32m   4241\u001b[0m         \u001b[0my\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mma\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mravel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0my\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   4242\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msize\u001b[0m \u001b[0;34m!=\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msize\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 4243\u001b[0;31m             \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"x and y must be the same size\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   4244\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   4245\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0ms\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mValueError\u001b[0m: x and y must be the same size"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD8CAYAAAB0IB+mAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAADYBJREFUeJzt3HGI33d9x/Hny8ROprWO5QRJou1YuhrKoO7oOoRZ0Y20fyT/FEmguEppwK0OZhE6HCr1rylDELJptolT0Fr9Qw+J5A9X6RAjudJZmpTALTpzROhZu/5TtGZ774/fT++4XHLf3v3uLt77+YDA7/v7fX6/e+fD3TO/fH/3+6WqkCRtf6/a6gEkSZvD4EtSEwZfkpow+JLUhMGXpCYMviQ1sWrwk3wuyXNJnrnC7Uny6SRzSZ5O8rbJjylJWq8hz/A/Dxy4yu13AfvGf44C/7T+sSRJk7Zq8KvqCeBnV1lyCPhCjZwC3pDkTZMaUJI0GTsn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LIwgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Visual Testing - Compare the result of your \n",
    "# integration code to the plot above\n",
    "\n",
    "thetas = get_integral_from_data(YAW_RATES, TIMESTAMPS)\n",
    "\n",
    "plt.scatter(TIMESTAMPS[1:], thetas)\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
